package com.caiyigo.struts.action;


import java.util.List;

import org.apache.log4j.Logger;

import com.caiyigo.struts.model.Employee;
import com.caiyigo.struts.service.IEmployeeService;
import com.caiyigo.struts.serviceImpl.EmployeeServiceImpl;
import com.opensymphony.xwork2.ActionSupport;

/**
 * 
 * @author xdwang
 * 
 * @date 2012-6-6 下午8:48:08
 * 
 * @email xdwangiflytek@gmail.com
 * 
 * @blog xdwangiflytek.iteye.com
 * 
 *       员工列表
 * 
 */
public class ListEmployeeAction extends ActionSupport {

	private static final long serialVersionUID = 1L;

	@SuppressWarnings("unused")
	private static Logger logger = Logger.getLogger(ListEmployeeAction.class
			.getName());

	private static IEmployeeService empService = new EmployeeServiceImpl();
	private List<Employee> employees;

	/**
	 * Create collection of Employee objects.
	 * 
	 * @return success
	 */
	public String execute() throws Exception {
		setEmployees(empService.getAllEmployees());

		return SUCCESS;

	}

	public List<Employee> getEmployees() {
		return employees;
	}

	public void setEmployees(List<Employee> employees) {
		this.employees = employees;
	}

}
